package anbook.util;

import java.text.SimpleDateFormat;

public class Converter {
	public java.sql.Date convertToDate(String year , String month , String day)
	{
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		java.util.Date parsed = null;
		
		try{
			StringBuffer sb = new StringBuffer();
			sb.append(year); sb.append("-");
			sb.append(month); sb.append("-"); sb.append(day);
			parsed = format.parse(sb.toString());
			java.sql.Date sql = new java.sql.Date(parsed.getTime());
			return sql;
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}
}
